<div class="detaiTab detaiTab1 m10">
	<form action="<@url value='/workflowsubmit/saveManger'/>"
		class="action-ajax-form" method="post">
		<p class="p10">收取保证金、管理费和风险补偿金</p>
		<div class="detaiTab b_t">
			<input type="hidden" name="id" value="${expand.id}" />
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tbody>
					 <tr>
						<td align="right" class="bg">缴费基数:</td>
						<td align="left" colspan="5"><@numberFormat
							value="${loan.eaMount}"/></td>
						<input id="eaMount" type="hidden" value="${loan.eaMount}" />
						<input type="hidden" name="loanapplyNo" id="loanapplyNo"
							value="${loan.loanapplyNo}" />
						<input type="hidden" name="loanTerm" id="loanTerm"
							value="${loan.loanTerm}" />
					</tr>
					<tr>
						<td align="right" class="bg" width="18%">保证金费率:</td>
						<td align="left" width="20%"><@select id="desposit"
							dataSouceType="O2ODEPOSITFEERATE" name="depositrate"
							value="${expand.depositrate}" renderonly="true"/></td>
						<td align="right" class="bg" width="18%">管理费费率:</td>
						<td align="left" width="15%"><@select id="manger"
							dataSouceType="O2OMANAGEFEERATE" name="managefeerate"
							value="${expand.managefeerate}" renderonly="true"/></td>
						<td align="right" class="bg" width="18%">风险补偿金费率:</td>
						<td align="left" width="15%">${expand.risk*100}%</td>
					</tr> 

					<tr>
						<td align="right" class="bg">应收保证金:</td>
						<td align="left"> 
						<input type="text" class="bn" value="<@numberFormat value='${expand.recDeposite}'/>" readonly="readonly" />
						</td>
						<td align="right" class="bg">应收管理费:</td>
						<td align="left"><input class="bn inputNum" type="text"
							value="<@numberFormat value='${expand.recManger}'/>"
							readonly="readonly" />
							</td>
						<td align="right" class="bg">应收补偿金:</td>
						<td align="left"><input class="bn inputNum" type="text"
							value="<@numberFormat value='${expand.recRisk}'/>"
							readonly="readonly" />
							</td>
					</tr>

					<tr>
						<td align="right" class="bg">已收保证金:</td>
						<td align="left"><input
							class="bn inputNum" type="text"
							value="<@numberFormat value='${expand.redDeposite}'/>"
							readonly="readonly" />
						</td>
						<td align="right" class="bg">已收管理费:</td>
						<td align="left"><input
							class="bn inputNum" type="text"
							value="<@numberFormat value='${expand.redManger}'/>"
							readonly="readonly" />
						</td>
						<td align="right" class="bg">已收补偿金:</td>
						<td align="left"><input
							class="bn inputNum" type="text"
							value="<@numberFormat value='${expand.redRisk}'/>"
							readonly="readonly" />
						</td>
					</tr>

					<tr>
						<td align="right" class="bg" title="本次缴纳保证金=本次保证金打款金额+本次保证金划拨金额"><span class="wenhaoIco"></span>本次缴纳保证金:</td>
						<td align="left">
							<input type="hidden" id="recDeposite" name="recDeposite" value="${expand.paidDeposite}"/>
							<input class="bn inputNum" type="text" value="<@numberFormat value='${expand.paidDeposite}'/>" readonly="readonly" /> 
						</td>
						<td align="right" class="bg">本次缴纳管理费:</td>
						<td align="left"><input class="bn inputNum" type="text" 
							value="<@numberFormat value='${expand.paidManger}'/>"
							readonly="readonly" />
							<input class="bn inputNum" type="hidden"
							name="paidManger" id="receManagereMargin"
							value="${expand.paidManger}" />
							</td>
						<td align="right" class="bg">本次缴纳补偿金:</td>
						<td align="left"><input class="bn inputNum" type="text"
							value="<@numberFormat value='${expand.paidRisk}'/>"
							readonly="readonly" />
							<input class="bn inputNum" type="hidden"
							name="paidRisk" id="recRisk"
							value="${expand.paidRisk}"/>
							</td>
					</tr>

					<tr>
						<td align="right" class="bg"><span style="color: red;"></span>本次保证金打款金额:</td>
						<td align="left"><input  type="text" name="receiveDeposit"  class="bn"
							id="receiveDeposit" value="${expand.paidDeposite}" onchange="OnChangDeposit()"  readonly="readonly"/> </td>
						<td align="right" class="bg"><span style="color: red;">*</span>付款人:</td>
						<td align="left"><input type="text" name="payName"
							id="loanerName" value="${expand.payName}" /></td>
						<td align="right" class="bg"><span style="color: red;">*</span>付款时间:</td>
						<td align="left"><@date value="${expand.submitDate}"
							id="submitDate" name ="submitDate"/></td>
					</tr>
					<#if loanapplyExpandDetail!=null>
					<tr>
						<td align="right" class="bg"><span style="color: red;"></span>本次划拨保证金单号:</td>
						<td align="left"><input type="hidden" name="transferNum"
							id="transferNum" class="inputNum bn"
							value="${expand.transferNum}" readonly="readonly" />${expand.transferNum}</td>
						<td align="right" class="bg"><span style="color: red;"></span>本次保证金划拨金额:</td>
						<td align="left"><input type="text" name="transferDeposit"
							id="transferDeposit" class="inputNum bn"
							value="${expand.transferDeposit}" readonly="readonly" /></td>
						<td align="right" class="bg"><span style="color: red;">*</span>本次打款合计金额:</td>
						<td align="left"><input type="text" class="bn" id="total" readonly="readonly"></td>
					</tr> 
					<#else>
					<tr>
						<td align="right" class="bg">
							划拨保证金单号列表:
							</td>
						<td colspan="5">
							<div class="dataBable ">
							<#if billCodeList?? && (billCodeList?size>0)>
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<thead>
										<tr><th>可划拨单号</th><th>可划拨金额</th></tr>
									</thead>
								 	<tbody>
								 		<#list billCodeList as deposit> 
									 	 <tr>
									 	 <td>
										 <input type="checkbox" name="transferNums" value="${deposit.billCode}">${deposit.billCode}</td>
									     <td><input class="bn" readonly="readonly" type="text" name="transferDeposits" value="${deposit.tranDeposit}"></td>
										 </tr>
										 </#list>
								 	</tbody>
								</table>
								<#else>
							无
							<tr>
							<td align="right" class="bg"><span style="color: red;">*</span>本次打款合计金额:</td>
							<td align="left" colspan="5"><input type="text" class="bn" id="total" readonly="readonly"></td>
							</tr> 
							</#if>
							</div>
						</td>
					</tr>
					</#if>
					<tr>
						<td align="right" class="bg">付款备注信息:</td>
						<td colspan="5"><textarea name="payRemark" rows="3"
								style="width:70%;" id="payRemark">${expand.payRemark}</textarea></td>
					</tr>
					<tr>
						<td class="bg" align="right">操作:</td>
						<td colspan="5">
						<#if billCodeList?? && (billCodeList?size>0)>
						<a href="/workflowsubmit/restart?id=${loanapplyExpandDetail.id}" class="btn_auto_30 btn_blue action-ajax-btn-confirm" action-ajax-form-confirm-message>重新划拨</a>
						</#if>
						<input type="submit" value="保存"
							class="btn_auto_30 btn_blue" /><span class="red fs14  ml10">(提示：请先点击【保存】按钮，再审核该单据！)</span></td>
					</tr>
					<tr>
						<td class="bg" align="right"></td>
						<td colspan="5"><a
							href="<@url value='/payment/upload?referId=${loan.loanapplyNo}'/>"
							target="_blank">补充附件</a></td>
					</tr>
					<tr>
						<td align="right" class="bg">收费账户信息如下：</td>
						<td align="left" colspan="5">账户名称：深圳市怡亚通流通服务有限公司<br>账号：7718 6868 5361 
							 <br>开户银行名称：中国银行深圳上步支行
							 <br>
							 <div class = 'red mt5'>
							 村镇银行为放款后代扣，无需客户手动打款
							 </div>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
	</form>
</div>
<div class="openBox action-ajax-load"
	data-url="<@url value='/workflowcheck/sqbzjfile?loanapplyNo=${loan.loanapplyNo}'/>"
	id="file_uploader"></div>
<@js> 
	$(document).ready(function(){
	var recDeposite=$("#receiveDeposit").val()*1;
	var receManagereMargin=$("#receManagereMargin").val()*1;
	var recRisk=$("#recRisk").val()*1;
	var count=recDeposite+receManagereMargin+recRisk;
	$("#total").val(count.toFixed(2));
 });
</@js>
 <@jsRender/>
